import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        int[] arr={4,2,3,4};
        Arrays.sort(arr);
        int ret=0,n=arr.length;
        for (int i = n-1; i >=2 ; i--) {
            int left=0,right=i-1;
            while (left<right) {
                if(arr[left]+arr[right]>arr[i]) {
                    ret+=right-left;
                    right--;
                }
                else left++;
            }
        }
        System.out.println(ret);
    }
}
